package com.bite.blog.mapper;

import com.bite.blog.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    /**
     * 通过姓名查询用户
     */
    @Select("select id, user_name, password, github_url from user where user_name = #{userName} and delete_flag = 0")
    User queryByName(String userName);

    /**
     * 通过ID查询用户
     */
    @Select("select id, user_name, github_url from user where id = #{id} and delete_flag = 0")
    User queryById(Integer id);
}
